<template>
  <div class="user">
    <div class="header">
      <nav-header
        name="protfolio"
        :is-bgc="true"
        bgc="#000"
        class="nav"
      ></nav-header>
      <div class="container header__breadcrumb">
        <el-breadcrumb :separator="'>'">
          <el-breadcrumb-item :to="{ path: '/' }">homepage</el-breadcrumb-item>
          <el-breadcrumb-item>promotion management</el-breadcrumb-item>
          <el-breadcrumb-item>promotion management</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
    </div>
    <div class="container">
      <div class="wrapper">
        <el-row :gutter="20">
          <!-- <el-col :span="7"> -->
          <el-col :xs="24" :sm="7">
            <div class="wrapper__left" ref="wrapperLeftRef">
              <!-- user 头像信息 -->
              <wrapper-left-user></wrapper-left-user>
              <!-- 功能菜单 -->
              <wrapper-left-menu
                @menuSelect="handleMenuSelect"
              ></wrapper-left-menu>
            </div>
          </el-col>
          <el-col :xs="24" :sm="17">
            <div class="wrapper__right" ref="wrapperRightRef">
              <router-view></router-view>
            </div>
          </el-col>
        </el-row>
      </div>
    </div>

    <div class="footer">
      <im-footer></im-footer>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import wrapperLeftUser from './cpns/wrapper-left-user.vue'
import wrapperLeftMenu from './cpns/wrapper-left-menu.vue'
import ImFooter from '@/components/im-footer'

const wrapperLeftRef = ref()
const wrapperRightRef = ref()
const handleMenuSelect = () => {
  if (document.documentElement.clientWidth < 750) {
    wrapperLeftRef.value.style.display = 'none'
    wrapperRightRef.value.style.display = 'block'
  } else {
    wrapperLeftRef.value.style.display = 'block'
    wrapperRightRef.value.style.display = 'block'
  }
}

window.addEventListener('resize', handleMenuSelect)
</script>

<style lang="less" scoped>
.user {
  width: 100%;
  background: #000;

  .wrapper {
    margin-bottom: 30px;
    border-radius: 20px;
  }
}
.header {
  // position: relative;
  &__breadcrumb {
    margin-top: 0.5%;
    margin-bottom: 0.5%;

    font-size: 22px;
    font-family: SF Pro Text;
    font-weight: 400;
    line-height: 35px;
    color: #ffffff;
    opacity: 1;
  }
  &__nav {
    // background-color: rebeccapurple;
    // margin-left: 212px;

    position: relative;
    margin-top: 15px;
    // width: 213px;
    height: 26px;
    // font-size: 22px;
    font-family: SF Pro Text;
    font-weight: 400;
    line-height: 35px;
    color: #ffffff;
    opacity: 1;
  }
}

.wrapper__right {
  display: block;
}
.row {
  justify-content: space-between;
}

:deep(.el-col-1) {
  max-width: 1% !important;
}
:deep(.el-breadcrumb) {
  font-size: 1rem;
  font-family: SF Pro Text;
  font-weight: 400;
  line-height: 35px;
  color: #ffffff;
  opacity: 1;
}
:deep(.el-card) {
  border-radius: 20px;
  background: #1c1c24;
  border: none;
}
:deep(.el-card__body) {
  padding: 0px;
}
@media screen and (max-width: 768px) {
  .header {
    height: 62px;
  }
  .header__breadcrumb {
    display: none;
  }
  .wrapper {
    margin-top: 20px;
    &__right {
      margin-top: 21px !important;
      display: none;
    }
  }

  :deep(.el-card) {
    border-radius: 20px;
    background: transparent;
    border: none;
  }

  .wrapper__left__menu {
    margin-bottom: 200px;
  }
}
</style>
